package com.elephant.createBan.resolveBeforeInstantiation;

import org.aopalliance.intercept.MethodInvocation;
import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @author 林
 * @create 2025-06-12 15:56
 */
public class MyMethodInterceptor implements MethodInterceptor {
	@Override
	public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
		System.out.println("执行目标方法之前"+method);
		Object o1 = methodProxy.invokeSuper(o, objects);
		System.out.println("执行目标方法之后"+method);
		return o1;
	}
}
